import org.junit.*;
import org.junit.runner.*;
import org.junit.runner.notification.*;
import static org.junit.Assert.*;
import java.util.Arrays;

public class QueueStackTest {

    public static void main(String[] args) {
        Result result = JUnitCore.runClasses(QueueStackTest.class);
        for (Failure failure : result.getFailures()) {
            System.out.println(failure.getTestHeader() + ": " + failure.getMessage());
        }
        System.out.println(result.wasSuccessful());
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }
    
    @Test
    public void test1() throws Exception {
        QueueStack<Integer> queue = new QueueStack<Integer>();
        queue.enqueue(0);
        queue.enqueue(1);
        queue.enqueue(2);
        queue.enqueue(3);
        queue.enqueue(4);

        assertEquals("1. Queue size test", 5, queue.size());
    }

    @Test
    public void test2() throws Exception {
        QueueStack<Integer> queue = new QueueStack<Integer>();
        queue.enqueue(0);
        queue.enqueue(1);
        queue.enqueue(2);
        queue.enqueue(3);
        queue.enqueue(4);

        assertEquals("2. Peek test", 0, (int)queue.peek());
    }

    @Test
    public void test3() throws Exception {
        QueueStack<Integer> queue = new QueueStack<Integer>();

        assertEquals("3. Null test", null, queue.dequeue());
    }

    @Test
    public void test4() throws Exception {
        QueueStack<String> queue = new QueueStack<String>();
        queue.enqueue("1");
        queue.enqueue("2");
        queue.enqueue("3");

        assertEquals("4. String format test", "1", queue.dequeue());
    }

}

